<?php


namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class hospitalInformation extends Model
{
    use HasFactory;
    use SoftDeletes;
    protected $guarded=[];
    protected $table='hospital_information';
    /**
     * 医院信息展示
     * @return mixed
     */
    public static function lists(){
        return self::paginate(10);
    }
    /**
     * 医院信息查找
     * @param $where
     * @return mixed
     */
    public static function Seek($field,$where){
        return self::where($field,'like',"%$where%")->get();
    }
    /**
     * 医院信息删除
     */
    public static function del($id,$fangId){
        return self::where([$id=>$fangId])
            ->delete();
    }
    /**
     * 医院详情信息
     */
    public static function detail($field,$where){
        return self::where($field,$where)->first();
    }
    /**
     * 医院信息修改
     */
    public static function change($field,$fangID,$SecondaryMessageUpdated){
        $data= self::where($field,$fangID,$fangID)->first();
        return $data->fill($SecondaryMessageUpdated)
            ->save();
    }
}
